<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title></title>
</head>
<body>
<h1>admin</h1>
<div class="btn-box">
	<button class="btn" onclick="logout()">退出</button>
</div>
</body>
<script>
	function logout() {
		let xhr = new XMLHttpRequest();
		xhr.open('POST', '/logout');
		var nonceId = localStorage.getItem('nonceId');
		xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		xhr.setRequestHeader('nonceId', nonceId);
		xhr.send();
		xhr.onreadystatechange = function() {
			console.log(xhr.responseText)
			if (xhr.readyState === 4 && xhr.status === 200) {
				window.location.href = 'http://micro-service-gateway/login-ui';
			}
		}
	}
</script>
</html>